package com.winter.boot.config;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class RootBeanDefinition implements BeanDefinition {

    private volatile Object beanClass;
    private Class<?> classTag;
    private List<Class<?>> params = new ArrayList<>();

    @Override
    public Object getBeanClass() {
        return beanClass;
    }

    @Override
    public List<Class<?>> getParams() {
        return params;
    }

    @Override
    public void setParams(Class<?>... classes) {
        params = Arrays.asList(classes);
    }

    @Override
    public void setBeanClass(Class<?> aclass) throws InstantiationException, IllegalAccessException {
        this.beanClass = aclass.newInstance();
    }

    public Class<?> getClassTag() {
        return classTag;
    }

    public void setClassTag(Class<?> classTag) {
        this.classTag = classTag;
    }
}
